/*
 * global.h
 *
 *  Created on: 2016-10-14
 *      Author: m
 */

#ifndef SRC_INCLUDE_GLOBAL_H_
#define SRC_INCLUDE_GLOBAL_H_
#include "protect.h"
#include "proc.h"
#include "tty.h"

#define TTY_COUNT       (3)
#define FILE_DESC_MAX   (64)

extern u16 g_cur_pos; //@bss
extern u16 g_tty_start_addr;
extern char g_text_attr;

extern GDT_PTR g_gdt_ptr;
extern GDT_PTR g_idt_ptr;
extern DESCRIPTOR g_gdt[GDT_ITEM_COUNT];
extern GATE g_idt[IDT_ITEM_COUNT];
extern TSS g_tss;
extern PROCESS g_proc_table[NR_TASKS];
extern PROCESS* g_proc_ready;
extern int g_reenter;
extern TASK g_task_table[NR_TASKS];
extern irq_handler g_irq_table[];
extern system_call g_syscall_tab[NR_SYSCALL];
extern unsigned int g_ticks;
extern TTY g_tty_tab[TTY_COUNT];
extern CONSOLE g_console_tab[TTY_COUNT];
extern u8 g_cur_tty_idx;

extern FILE_DESC g_fd_table[FILE_DESC_MAX];

#endif /* SRC_INCLUDE_GLOBAL_H_ */
